<div class="acomment">
<div class="acomment-left">
<div class="">
<img src='<?=member_util_avatar::get_avatar($thread[0]['author_id'],'small')?>' />

</div>
</div><!--acomment_left-->

<div class="acomment-right">
<div class="a-r-top">
<span class="a-r-time"><?= date('Y-m-d H:i:s',$thread[0]['create_time'])?></span>
<a href="http://i.<?=DOMAIN?>/?uid=<?= $thread[0]['author_id'] ?>"><?= $thread[0]['author_name']?></a>说道：
<div class="clearfix">&nbsp;</div>
</div><!--a_r_top-->
<div class="a-r-main" id="comment_thread<?= $thread[0]['id']; ?>">;
<script type="text/javascript">
$("comment_thread<?= $thread[0]['id']; ?>").innerHTML = UBBCode.transform("<?= preg_replace(array("/\n/","/\r/"), array("<br />",""), addslashes($thread[0]['content']))?>");
</script>
<? //preg_replace($_SERVER['config']['smile']['searcharray'],$_SERVER['config']['smile']['replacearray'],$thread[0]['content']); ?>

</div><!--a_r_main-->
<? if(count($thread) == 1) :?>
	<div class="a-r-bottom">	
	<a onclick="comments.show_reply('reply_<?= $thread[0]['thread_id']?>')" href="javascript:;"回复</a>
	
	<a href="javascript:;" onclick="comments.show_reply('reply_<?= $thread[0]['thread_id']?>')"><span class="sicon reply_icon"></span>回复</a>
	
	<?if($this->login_uid == $thread[0]['author_id'] || $this->res_uid == $this->login_uid ):?>
	
	<span class="spacing-line">|</span>
	<a onclick="comments.remove_comment(<?= $thread[0]['thread_id']?>)" href="javascript:;">删除</a>
	<?endif;?>

	</div>

<? else:?>
<!-- 回复框 -->
<? $num = count($thread); for($i=1;$i<$num;$i++):?>
	<div class="reply-box">
	<div class="acomment" <?if($this->login_uid == $thread[$i]['author_id'] || $this->res_uid == $this->login_uid ):?> onmouseover="this.className='a_r_top arthover';document.getElementById('<?=$thread[$i]['id'];?>').style.visibility='visible'"   <?endif;?>
 onmouseout="this.className='a_r_top';document.getElementById('<?=$thread[$i]['id'];?>').style.visibility='hidden';">
	<div class="acomment-left">
		<div class="avatar25">
			<a href="/?uid=<?=$thread[$i]['author_id']?>">
			<img src='<?= member_util_avatar::get_avatar($thread[$i]['author_id'], 'small')?>' height="25" width="25"/>
			</a>
		</div>
	</div>
	<!--acomment_left-->
	<div class="acomment-right">
<div class="a-r-top" >
			<span class="a-r-time"><?= date('Y-m-d H:i:s',$thread[$i]['create_time']); ?>
<?if($this->login_uid == $thread[$i]['author_id'] || $this->res_uid == $this->login_uid ):?>
			<a href="javascript:;" class="del-classify" target="_self" onclick="comments.remove_comment_post(<?= $thread[$i]['thread_id']?>,<?= $thread[$i]['id']?>)"></a>
<?endif;?>
			</span>
			
			<a href="http://i.<?=DOMAIN?>/?uid=<?=$thread[$i]['author_id']?> "> <?= $thread[$i]['author_name']?></a>回复:
			<div class="clearfix">&nbsp;</div>
		</div><!--a_r_top-->
		<div class="a-r-main" id="comment_thread<?= $thread[$i]['id']; ?>">
		<script type="text/javascript">
			$("comment_thread<?= $thread[$i]['id']; ?>").innerHTML = UBBCode.transform("<?= preg_replace(array("/\n/","/\r/"), array("<br />",""), addslashes($thread[$i]['content']))?>");
		</script>
		</div><!--a_r_main-->
	
	</div><!--acomment_right-->
		<div class="clearfix">&nbsp;</div>
	</div><!--acomment-->
	</div><!--reply_box-->
		<div class="a-r-bottom">		
		<? if($i==$num-1) :?>
				<a href="javascript:;" onclick="comments.show_reply('reply_<?= $thread[0]['thread_id']?>')" >回复</a>		
			<?if($this->login_uid == $thread[0]['author_id'] || $this->res_uid ==$this->login_uid ):?>
			<span class="spacing-line">|</span>
			<a href="javascript:;" onclick="comments.remove_comment(<?= $thread[0]['thread_id']?>)">删除</a>
			<?endif;?>
		<? endif;?>
		</div>
		
<? endfor ; ?>

<? endif;?>

<!--回复框-->
<div id='reply_<?= $thread[0]['thread_id']?>' style="display:none">
<div class="sm-table"></div>
<form id='comment_reply_<?= $thread[0]['thread_id']?>' name='comment_reply_<?= $thread[0]['thread_id']?>' action="/?_app=comment&_controller=index&_action=reply_comment" method="post" >
<table>
<tr>
<td>
<div class="clearfix">&nbsp;</div>
<div id="content_div_<?= $thread[0]['thread_id']?>"></div>
<script type="text/javascript">
content_id_<?= $thread[0]['thread_id']?> = new webEditor(
	"content_id_<?= $thread[0]['thread_id']?>" , 
	$("content_div_<?= $thread[0]['thread_id']?>") , 
	420, 
	80
);
content_id_<?= $thread[0]['thread_id']?>.init('');
</script>
<input type="hidden" name="content" value="" />
</div>

</td>
</tr>
<tr>
<td class="send-submit">
<div class="send-submit-mr">
	   <div id='comment_reply_<?= $thread[0]['thread_id']?>_msg'>
	   </div>
<span class="send-submit-mr-text">字数限制1000个</span>
<!--<input type="checkbox"/>悄悄话--><input name='thread_id' type="hidden"  value=<?= $thread[0]['thread_id']?>  />
<button class="cbtn" type="button" onclick="comments.reply_comment('comment_reply_<?= $thread[0]['thread_id']?>', content_id_<?= $thread[0]['thread_id']?>);">发表</button>

</div>
</td>
</tr>
</table>
</form>
</div>


<!--回复框-->
</div><!--acomment_right-->
<div class="clearfix">&nbsp;</div>
</div><!--acomment-->

